package com.link2room.bumblebee.controller.inside;


import com.link2room.bumblebee.dto.param.base.PmsReservationOptionParamDto;
import com.link2room.bumblebee.dto.result.base.PmsReservationOptionDto;
import com.link2room.bumblebee.facade.IPmsReservationOptionFacadeService;
import com.link2room.common.dto.result.base.BaseResultDto;
import com.link2room.common.dto.result.base.SysOptionDto;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * 获取sysOptions
 * Created by Ln on 2016/12/20.
 */
@Api(tags = "pms订单相关设置")
@RestController
@RequestMapping("/in/PmsReservationOptions")
public class PmsReservationOptionInsideController {
    @Resource
    private IPmsReservationOptionFacadeService pmsReservationOptionFacadeService;

    @ApiOperation(value = "pms订单相关设置", response = SysOptionDto.class)
    @ApiImplicitParams(value = {
            @ApiImplicitParam(name = "pbChannel",value = "渠道", paramType = "query", required = true),
            @ApiImplicitParam(name = "resType",value = "resType", paramType = "query", required = true),

    })
    @RequestMapping(value = "/PmsReservationOption",method= RequestMethod.GET)
    public @ResponseBody
    BaseResultDto getPmsReservationOption(
            @RequestParam(value = "pbChannel" ) String pbChannel,
            @RequestParam(value = "resType") String resType
    ) throws Exception {
        PmsReservationOptionParamDto paramDto = new PmsReservationOptionParamDto();
        paramDto.setPbChannel(pbChannel);
        paramDto.setResType(resType);
        PmsReservationOptionDto res = pmsReservationOptionFacadeService.getPmsReservationOptionDto(paramDto);
        BaseResultDto l2rRs=new BaseResultDto();
        l2rRs.setResultCode(0);
        l2rRs.setResultInfo(res);
        return l2rRs;
    }
}
